package com.zh.note.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @Author: zhanghuan
 * @date: 2023/5/8 22:16
 * @description: create it
 */
@Component
public class EventPublisher {

    @Autowired
    private ApplicationContext applicationContext;


    public <T> void publish(T event) {
        applicationContext.publishEvent(event);
    }
}
